﻿using UnityEngine;
using UnityEditor;

[CustomEditor( typeof( FX_UVscroll_delay ) )]
public class FX_UVscroll_delayInspector : Editor
{
	public override void OnInspectorGUI()
	{
		var info = target as FX_UVscroll_delay;
		EditorGUILayout.BeginHorizontal();
		EditorGUILayout.LabelField( "Target Material Slot", GUILayout.Width( 80 ) );
		info.targetMaterialSlot = EditorGUILayout.IntField( info.targetMaterialSlot );
		EditorGUILayout.EndHorizontal();

		EditorGUILayout.BeginHorizontal();
		info.MaxTime = EditorGUILayout.FloatField( "Time", info.MaxTime );

		info.DelayTime = Mathf.Max( EditorGUILayout.FloatField( "Delay", info.DelayTime ), 0f );
		EditorGUILayout.Space();
		EditorGUILayout.EndHorizontal();

		EditorGUILayout.Space();
		EditorGUILayout.BeginHorizontal();
		EditorGUILayout.LabelField( "X", GUILayout.Width( 30 ) );
		info.AxisX = EditorGUILayout.CurveField( info.AxisX, Color.red, new Rect( 0, -1, 1, 2 ) );

		EditorGUILayout.LabelField( "Y", GUILayout.Width( 30 ) );
		info.AxisY = EditorGUILayout.CurveField( info.AxisY, Color.green, new Rect( 0, -1, 1, 2 ) );
		EditorGUILayout.EndHorizontal();
	}
}
